package cn.mastor.service.impl;

import cn.mastor.domain.User;
import cn.mastor.mapper.UserMapper;
import cn.mastor.service.IUserService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import mihoyo.result.JSONResult;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author whale
 * @since 2022-12-10
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
    @Override
    public JSONResult selectByGameId(Long id,Integer sex) {
        Wrapper<User> wrapper= new EntityWrapper();
        if (id!=null){
            wrapper.eq("game_id",id);
        }
        if (sex!=null){
            wrapper.eq("sex",sex);
        }
//        selectPage()
        return JSONResult.success(selectList(wrapper));
    }
}
